Namespace Actions
    Public Class ActionParameter
        Public Enum TypeEnum
            tpString
            tpPassword
            tpDate
        End Enum

        Public ReadOnly Name As String
        Public ReadOnly Type As TypeEnum = TypeEnum.tpString
        Public Value As Object = CType("", Object)

        Public Shared Function TypeEnumFromString(ByVal what As String) As TypeEnum
            what = what.ToLower
            Select Case what
                Case "password"
                    Return TypeEnum.tpPassword
                Case "date"
                    Return TypeEnum.tpDate
                Case Else
                    Return TypeEnum.tpString
            End Select
        End Function

        Sub New(ByVal Name As String, Optional ByVal Type As TypeEnum = TypeEnum.tpString)
            Me.Name = Name
            Me.Type = Type
        End Sub

        Public Function FormattedValue() As String
            If Type = TypeEnum.tpPassword Then
                Return "**********"
            Else
                Return Value.ToString
            End If
        End Function
    End Class
End Namespace